package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by Administrator on 2017/10/10.
 * 点赞api
 */

public class ForumThumbsUpApi extends BaseApi {
    ForumThumbsUpReq req;


    public ForumThumbsUpApi(String post_id, String member_id) {
        req = new ForumThumbsUpReq(post_id, member_id);
    }


    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getForumThumbsUp(requestBody);
    }

    private class ForumThumbsUpReq {
        public String post_id;
        public String member_id;

        public ForumThumbsUpReq(String post_id, String member_id) {
            super();
            this.post_id = post_id;
            this.member_id = member_id;
        }
    }
}